//
//  Toolobject.h
//
//  Created by lucas on 15/1/12.
//  Copyright (c) 2015年 lucas. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface Toolobject : NSObject


+(NSInteger )returnthenetwork; //返回网络状态 0.无网络 1.蜂窝数据 3.wifi

+(NSString *)deleteSpacebar:(NSString *)str;  //删除空格 判断非空字符串时使用;

+(void)showAlterwithMessage:(NSString *)str;
+(void)showAlterwithMessage:(NSString *)str inVC:(UIViewController *)vc;

+(void) showTextWithMessage:(NSString*) str;

+(BOOL) validateEmail: (NSString *) candidate; //邮箱格式检测

+(BOOL)validateNumber:(NSString *)str;     //整形数字检测

+(BOOL)str:(NSString *)str1 ishas:(NSString *)str2; //检测str1是否包含str2

+(BOOL)isfloat:(NSString*)string; //float数字检测

+(NSString *)GetString:(NSDictionary *)dic forkey:(NSString *)key;//字典中取对象 初始化为字符串//防止纯数字是成为nsnumber

+(UIImage *)fixOrientation:(UIImage *)aImage;  //照片修正保存orientation

+(BOOL)isPureNumber:(NSString*)string;
//+(NSString *)md5sum ;
+(NSString *)intervalFromLastDate: (NSString *) dateString1 toTheDate:(NSString *) dateString2;//比较时间返回差值
+(int)compareOneDay:(NSDate *)oneDay withAnotherDay:(NSDate *)anotherDay;//时间大小比较 返回 1：oneday大  -1 anotherDay大  0：一样大
+(NSString *)stringwithfoarmat:(id)object;//转成string格式

+(Boolean) IsEmptyString:(NSString*) string; // 是否为空字符串

//判断设备相机是否可用
+ (BOOL)isCameraAvailable;
// 时间格式转化为字符串
+ (NSString *)stringFromDate:(NSDate *)date WithFormatter:(NSString *)dateFormatter;
+ (NSString *)DateString:(NSString *)inputDateStr FromDateFormatter:(NSString *)inputDateFormatter ToDateFormatter:(NSString *)outputDateFormatter;

//手机号校验
+ (BOOL) isMobile:(NSString *)mobileNumbel;

//16进制获取颜色
+(UIColor *) getColorByHexString: (NSString *) stringToConvert  alpha:(CGFloat)alpha;

//rgb获取颜色
+(UIColor*)getColorByRGB:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha;

//是否是AppStore测试账号
+(BOOL) isAppStoreTestAccount;

/**
 计算字符串长度
 
 @param string 字符串
 @param fontSize 字符size
 @return 字符串长度
 */
+ (CGFloat)widthForString:(NSString *)string height:(CGFloat)height fontSize:(CGFloat)fontSize;
/**
 计算字符串高度
 
 @param string 字符串
 @param fontSize 字符size
 @return 字符串高度
 */
+ (CGFloat)heightForString:(NSString *)string width:(CGFloat)width fontSize:(CGFloat)fontSize;

@end




